-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL][RTC] Add minimum amount of post-link functionality to extract symbol table and properties #16109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
|
I think @cperkinsintel is much more familiar with this code than I am, so I'll leave this review to him. |
sommerlukas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some stylistic nits.
| static JITResult errorToFusionResult(llvm::Error &&Err, | ||
| const std::string &Msg) { | ||
| return wrapError<JITResult>(std::move(Err), Msg); | ||
| } | ||
|
|
||
| static RTCResult errorToRTCResult(llvm::Error &&Err, const std::string &Msg) { | ||
| return wrapError<RTCResult>(std::move(Err), Msg); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use wrapError directly (maybe with a different name)?
So, instead of errorToFusionResult or errorToRTCResult, we would call errorToResult<JITResult> and errorToResult<RTCResult>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errorToResult<T> makes sense, I initially decided against that to keep the diff a bit cleaner.
Co-authored-by: Lukas Sommer <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
…ect. Signed-off-by: Julian Oppermann <[email protected]>
sommerlukas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few stylistic nits.
| !F->use_empty()) { | ||
| // The element in "llvm.used" array has other users. That is Ok for | ||
| // specialization constants, but is wrong for kernels. | ||
| llvm::report_fatal_error("Unexpected usage of SYCL kernel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we ever expect to hit this during user code compilation? If yes, we should probably fail more gracefully and report back through a failed RTCResult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, however, I wasn't able to trigger the generation of llvm.used and llvm.compiler.used with the feature set we currently support. Hence I'm proposing to just assert that they're not present, and to drop the copied code from sycl-post-link for now.
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
Signed-off-by: Julian Oppermann <[email protected]>
|
@intel/llvm-gatekeepers Please merge this, thanks. |
|
Working on a fix for the post-commit failure. |
|
Thanks, tag me when it's ready |
Fixes post-commit failure due to an unused variable introduced by #16109. --------- Signed-off-by: Julian Oppermann <[email protected]>
This PR implements symbol table and property set extraction from the runtime-compiled module, based on the skeleton used by
sycl-post-link, assuming that no splitting of the module is required and/or requested. We add the necessary plumbing to pass this information to the runtime, which then reuses existingsycl-jitinfrastructure to create the necessary data structures for device binary images.We don't use the properties yet during the creating of the kernel bundles, but the necessary information to feed the images into the program manager is there.